home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 55375 / 55375.xpi / chrome / chromeFiles / content / btClient.js < prev    next >
Text File  |  2009-11-15  |  2KB  |  63 lines

  1. /* This file contains all client information */
  2. /* It HAS to be included first. */
  3.  
  4. if (typeof(BrandThunder) == "undefined") {
  5.   BrandThunder = {};
  6.   BrandThunder.clients = {};
  7. }
  8.  
  9. BrandThunder.clients.coolhandnuke = {
  10.   "shortName": "coolhandnuke",
  11.   "clientName": "Cool Hand Nuke",
  12.   "clientCode": "000155",
  13.   "askOriginCode": "101519",
  14.   "clientVersion": "001",
  15.   "clientCountry": "US",
  16.   "rebrandID": "",
  17.   "extensionID": "coolhandnukeboom@coolhandnuke.com",
  18.   /* This is the short name used in chrome.manifest (toolbar) */
  19.   "packageName": "coolhandnukeboom",
  20.   "welcomePage": "http://pages.brandthunder.com/coolhandnuke/firstrun",
  21.   "homePage": "http://coolhandnuke.com",
  22. //  "toolbarUpdateURL": "http://brandthunder.com/sports/social/coolhandnuke/toolbar.json",
  23.   "defaultSearchEngine": "Yahoo! - BT",
  24.   "booms": {
  25.     "coolhandnuke": "Cool Hand Nuke"
  26.   }
  27. }
  28.  
  29. /* I hate this, but I don't see any way around it. Firefox toggleSidebar doesn't
  30.    allow for custom parameters and we need them. */
  31.  
  32. if (typeof(toggleSidebar) != "undefined") {
  33.   if (!toggleSidebar.btReplaced) {
  34.     var origToggleSidebar = toggleSidebar;
  35.     
  36.     function btToggleSidebar(commandID, forceOpen) {
  37.       if (commandID) {
  38.         if (commandID.substring(0,3) == "bt-") {
  39.           var sidebarBox = document.getElementById("sidebar-box");
  40.           var commands = commandID.split('?');
  41.           if (commands.length > 1) {
  42.             sidebarBox.setAttribute("btSidebarParams", commands[1]);
  43.             if (!document.getElementById("sidebar-box").hidden) {
  44.               var sidebarid = window.top.document.getElementById("sidebar-box").getAttribute("sidebarcommand");
  45.               var sidebarurl = window.top.document.getElementById('sidebar').getAttribute("src");
  46.               if (sidebarid == commands[0]) {
  47.                 if (!(sidebarurl.match(commands[1]))) {
  48.                     origToggleSidebar();
  49.                 }
  50.               }
  51.             }
  52.           }
  53.           commandID = commands[0];
  54.         }
  55.       }
  56.       origToggleSidebar(commandID, forceOpen);
  57.     }
  58.     
  59.     toggleSidebar = btToggleSidebar;
  60.     toggleSidebar.btReplaced = true;    
  61.     toggleSidebar.origToggleSidebar = origToggleSidebar;
  62.   }
  63. }